ProxyMongoUpdateOne

 

Update the first item in MongoDB.

To use MongoDB, you need to have ProxyMongoDB.exe program running. (  https://files.autobase.biz/FileDownLoad/FileDownLoad.aspx?Folder=Proxy )

 

int @ProxyMongoUpdateOne(int connection_id, string collection_name, string filter, string update_text);

 

Parameters

int connection_id : Connection ID

string collection_name : Collection name

string filter : Filter Sentence (JSON Text)

string update_text : Update Sentence (JSON Text)

 

Return Value

Returns 1 if it succeeds, and 0 if it fails.

 

Example

connection_id = @ProxyMongoOpen("mongodb://192.168.1.149", "test");
if(connection_id == 0)
{
   @Message("Error. connection_id == 0");
   return;
}

string filter,
string update;
@sprintf(filter, "{PersonCount:50}");
@sprintf(update, "{ $set:{PersonCount:55} }");

int retn;

retn = @ProxyMongoUpdateOne(connection_id, "things", filter, update);
@ProxyMongoClose(connection_id);
if(retn == 0){
   @MessageBox(@GetLastError(), "MongoUpdateOne Error", MB_OK);
   return;
}

 

Description : Example of opening and using the test database of the 192.168.1.149 IP

 

Version Information

Supported Version: 10.3.5 or higher

 

Related Helps

@ProxyMongoClose()

@ProxyMongoDeleteMany()

@ProxyMongoDeleteOne()

@ProxyMongoFill()

@ProxyMongoInsert()

@ProxyMongoOpen()

@ProxyMongoUpdateMany()

@ProxyMongoUpdateOne()